StoreManager = {
		
	getComplaintStore: function(){
	    var url = "../popup/extjs/ComplaintJson.action";
	   //var fields = ["id", "comBigId", "comBigSeq", "comBigAddress","comBigLon","comBigLat","comBigClientLinkMan","comBigClientLinkTel","comBigInfo"];
	    var fields = ["id", "imepId", "woId", "dealTime","customerName","customerMobile","complaintContent","address","reason","longitude","latitude","resolve"];
	    return this.getStore(url, fields);
	},
	getAreaStore : function(){
		var url = "../popup/extjs/dictionary.action?keyword=AREA";
        var fields = ["key", "value"];
	    return this.getStore(url, fields);
	},
	getAreaTypeStore : function(){
		var url = "../popup/extjs/dictionary.action?keyword=areaType";
        var fields = ["key", "value"];
	    return this.getStore(url, fields);
	},
	getProjectTypeStore : function(){
		var url = "../popup/extjs/dictionary.action?keyword=projectType";
        var fields = ["key", "value"];
	    return this.getStore(url, fields);
	},
	getTermStore : function(){
		var url = "../popup/extjs/dictionary.action?keyword=term";
        var fields = ["key", "value"];
	    return this.getStore(url, fields);
	},
	getFactoryStore : function(){
		var url = "../popup/extjs/dictionary.action?keyword=factory";
        var fields = ["key", "value"];
	    return this.getStore(url, fields);
	},
	
	/*getGsmTermStore : function(){
		var url = "../popup/extjs/dictionary.action?keyword=gsmTerm";
        var fields = ["key", "value"];
	    return this.getStore(url, fields);
	},
	
	getTdTermStore : function(){
		var url = "../popup/extjs/dictionary.action?keyword=tdTerm";
        var fields = ["key", "value"];
	    return this.getStore(url, fields);
	},
	getLteTermStore : function(){
		var url = "../popup/extjs/dictionary.action?keyword=lteTerm";
        var fields = ["key", "value"];
	    return this.getStore(url, fields);
	},
	getWlanTermStore : function(){
		var url = "../popup/extjs/dictionary.action?keyword=wlanTerm";
        var fields = ["key", "value"];
	    return this.getStore(url, fields);
	},
	getGsmBuildType : function(){
		var url = "../popup/extjs/dictionary.action?keyword=gsmBuildType";
        var fields = ["key", "value"];
	    return this.getStore(url, fields); 
	},
	getTdBuildType : function(){
		var url = "../popup/extjs/dictionary.action?keyword=tdBuildType";
        var fields = ["key", "value"];
	    return this.getStore(url, fields); 
	},
	getlteBuildType : function(){
		var url = "../popup/extjs/dictionary.action?keyword=lteBuildType";
        var fields = ["key", "value"];
	    return this.getStore(url, fields); 
	},
	getWlanBuildType : function(){
		var url = "../popup/extjs/dictionary.action?keyword=wlanBuildType";
        var fields = ["key", "value"];
	    return this.getStore(url, fields); 
	},*/
    getStore: function(url, fields, root){
        return new Ext.data.JsonStore({
            url: url,
            fields: fields,
            root: root ? root : 'dataList',
            totalProperty: 'totalCount',
            idProperty: 'id',
            remoteSort: true
        });
    },
    
    fullAddrConvert: function(v, record){
        return record.area + " " + record.street
    },
    
    calcPodTime: function(pickuptime){
    
        if (pickuptime != "" && pickuptime != null) {
            var originId = Ext.getCmp("senderAddressZoneId").getValue();
            var destId = Ext.getCmp("recipientAddressZoneId").getValue();
            var customerId = Ext.getCmp("customerId").getValue();
            if (originId != "" && destId != "" && customerId != "") {
                Ext.Ajax.request({
                    url: "../../popup/extjs/GetPodTimeJson.bl",
                    params: {
                        originId: originId,
                        destId: destId,
                        customerId: customerId,
                        pickuptime: pickuptime
                    },
                    scope: this,
                    success: function(response, options){
                        var data = Ext.util.JSON.decode(response.responseText);
                        Ext.getCmp("podRequestTime").setValue(data.podTime || "");
                        Ext.getCmp("timelimit").setValue(data.timelimit || "");
                    }
                });
            }
        }
        
    }
}

ComponentManager = {}

